<template>
  <el-row v-show="panelData.length==4" :gutter="30" class="panel-group">
    <el-col :xs="24" :md="12" :lg="6" class="card-panel-col">
      <div class="card-panel">
        <div class="card-panel-icon-wrapper icon-people">
          <svg-icon icon-class="peoples" class-name="card-panel-icon" />
        </div>
        <div class="card-panel-description">
          <div class="card-panel-text">APP总用户量</div>
          <div class="card-panel-num"><span>{{ panelData[0] }}</span></div>
        </div>
      </div>
    </el-col>
    <el-col :xs="24" :md="12" :lg="6" class="card-panel-col">
      <div class="card-panel">
        <div class="card-panel-icon-wrapper icon-money">
          <svg-icon icon-class="money" class-name="card-panel-icon" />
        </div>
        <div class="card-panel-description">
          <div class="card-panel-text">APP用户收益</div>
          <div class="card-panel-num"><span>{{ panelData[2] }}</span></div>
        </div>
      </div>
    </el-col>
    <el-col :xs="24" :md="12" :lg="6" class="card-panel-col">
      <div class="card-panel">
        <div class="card-panel-icon-wrapper icon-form">
          <svg-icon icon-class="form" class-name="card-panel-icon" />
        </div>
        <div class="card-panel-description">
          <div class="card-panel-text">APP阅读时长</div>
          <div class="card-panel-num"><span>{{ panelData[3] }}</span></div>
        </div>
      </div>
    </el-col>
    <el-col :xs="24" :md="12" :lg="6" class="card-panel-col">
      <div class="card-panel">
        <div class="card-panel-icon-wrapper icon-nested">
          <svg-icon icon-class="nested" class-name="card-panel-icon" />
        </div>
        <div class="card-panel-description">
          <div class="card-panel-text">APP用户喜好</div>
          <div class="card-panel-num"><span>{{ panelData[1] }}</span></div>
        </div>
      </div>
    </el-col>
  </el-row>
</template>

<script>
export default {
  props: {
    panelData: {
      type: Array,
      required: true
    }
  }
}
</script>

<style lang="scss" scoped>
.panel-group {
  margin-top: 18px;
  .card-panel-col{
    margin-bottom: 32px;
  }
  .card-panel {
    height: 108px;
    cursor: pointer;
    font-size: 12px;
    position: relative;
    overflow: hidden;
    color: #666;
    background: #fff;
    box-shadow: 4px 4px 40px rgba(0, 0, 0, .1);
    border-color: rgba(0, 0, 0, .1);
    display: flex;
    justify-content: space-around;
    &:hover {
      .card-panel-icon-wrapper {
        color: #fff;
      }
      .icon-people {
        background: #d48265;
      }
      .icon-nested {
        background: #34bfa3;
      }
      .icon-money {
        background: #f4516c;
      }
      .icon-form {
        background: #36a3f7;
      }
    }
    &.active{
      background: rgba(239,239,239,0.65);
      .card-panel-icon-wrapper {
        color: #fff;
      }
      .icon-people {
        background: #d48265;
      }
      .icon-nested {
        background: #34bfa3;
      }
      .icon-money {
        background: #f4516c;
      }
      .icon-form {
        background: #36a3f7;
      }
    }
    .icon-people {
      color: #d48265;
    }
    .icon-nested {
      color: #34bfa3;
    }
    .icon-money {
      color: #f4516c;
    }
    .icon-form {
      color: #36a3f7;
    }
    .card-panel-icon-wrapper {
      width:80px;
      height:80px;
      margin-top: 14px;
      padding: 16px;
      transition: all 0.38s ease-out;
      border-radius: 6px;
    }
    .card-panel-icon {
      font-size: 48px;
    }
    .card-panel-description {
      font-weight: bold;
      margin: 30px 0px;
      margin-left: 0px;
      .card-panel-text {
        line-height: 18px;
        color: rgba(0, 0, 0, 0.45);
        font-size: 16px;
        margin-bottom: 12px;
      }
      .card-panel-num {
        font-size: 12px;
        span{
          font-size: 17px;
        }
      }
    }
  }
}
</style>
